/**
    ******************************************************************************
    * @file    queue.h
    * @author  debian
    * @version V1.0.0
    * @date    2020-07-29
    * @brief   队列
    ******************************************************************************
    * @attention
    *
    *
    ******************************************************************************
    */ 

/* Define to prevent recursive inclusion -------------------------------------*/
#ifndef __QUEUE_H
#define __QUEUE_H

#ifdef __cplusplus
    extern "C" {
#endif

/* Includes ------------------------------------------------------------------*/


/** @addtogroup DataStruct_Driver
    * @{
    */

/** @addtogroup queue
    * @{
    */

/* Exported types ------------------------------------------------------------*/
/** @defgroup 
    * @{
    */ 
typedef struct task_s
{
    void *(*run)(void *arg);
    void *arg;
}task_t;

typedef struct queue_s
{
    int size;
    int capcity;
    int head;
    int tail;
    task_t *task;
}queue_t;


/**
    * @}
    */


/* Exported constants --------------------------------------------------------*/

/* Exported macro ------------------------------------------------------------*/

/* Exported functions --------------------------------------------------------*/ 
/* Initialization and de-initialization functions *******************************/
/** @addtogroup queue_Exported_Functions
    * @{
    */

/** @addtogroup queue_Exported_Functions_Group1
    * @{
    */
    queue_t* queue_creat(int size);
    int queue_destroy(queue_t* queue);
    int queue_is_full(queue_t* queue);
    int queue_is_empty(queue_t* queue);
    int queue_push_tail(queue_t* queue, task_t *task);
    task_t* queue_pop_head(queue_t* queue);
    int queue_pop_free(task_t* t);

/**
    * @}
    */

/* operation functions *******************************************************/
/** @addtogroup queue_Exported_Functions_Group2
    * @{
    */



/**
    * @}
    */

/**
    * @}
    */ 

/**
    * @}
    */

/**
    * @}
    */


#ifdef __cplusplus
}
#endif

#endif /* __QUEUE_H */

/******************* (C) 2020 HOME 深圳龙华 *****END OF FILE****/

